package com.boco.blch.analysiser.compliance.HW.data;


import com.boco.blch.analysiser.compliance.ComplianceResolved;

/**
 * @author 黄戈
 * MPPDB 运行程序帐号权限最小化安全基线要求项
 *
 */

public class BOCO_gbase_VisitCtl_AppAcountMinAuth implements ComplianceResolved {
	
	@Override
	public int realEchoResolved(String echoResult) {
		boolean Flag=true;
		if(!echoResult.equals("")&&echoResult!= null&&(!echoResult.contains(NoPermission1)&&!echoResult.contains(NoPermission2)&&!echoResult.contains(NoPermission3))){
		String[] Results=echoResult.split("\n");
		for(int i=0;i<Results.length;i++){
			if(Results[i].contains(":")){
			String[] Result=Results[i].split(" : ");
			if(Result[0].equals("root")||Result[0].equals("supervisor")|Result[0].equals("administrator")){
				Flag=false;
				break;
			}else if(Result[1].equals("root")||Result[1].equals("super")||Result[1].equals("administrator")||Result[1].equals("sys")){
			    Flag=false;
				break;
			}else{
				Flag=true;
			}
		}
		}
		}else{
			return FAILED;
		}
		
		
		if(Flag){
			return SUCCESS;
		}else{
			return FAILED;
		}
		
	}
	

	
}
